
int find(int *a,int n,int key)
{
    int ans=-1;
    int i;
    for(i=0; i<n; i++)
        if(a[i]==key){
            ans=i;
            break;
        }
    return ans;
}
int find2(int *a,int n,int key)
{
    int i;
    for(i=0; i<n; i++)
        if(a[i]==key)
            return i;
    return -1;
}

int main()
{
    int a[]= {9,7,8,5,4,6,1,2,3,0,6};
    int key=5,n=sizeof(a)/sizeof(a[0]);
    int pos=find(a,n,key);
    printf("%d\n",a[pos]);//a[pos]==key
    pos=find(a+1,n-1,key);//(a+1)[pos]==key
    printf("%d\n",(a+1)[pos]);
    int *p=a+1;
    printf("%d\n",p[pos]);
    printf("%d\n",*(p+pos));


}
